#!/bin/bash

# Determine OS release
OSREL=`lsb_release -is 2>/dev/null`

# On first install, add joy user and group
#
if [ "$OSREL" == "CentOS" -o "$OSREL" == "RedHatEnterpriseServer" ]; then
    /usr/sbin/groupadd -r joy 2> /dev/null || :
    /usr/sbin/useradd -g joy -s /sbin/nologin -M -r -d / joy 2> /dev/null || :
elif [ "$OSREL" == "Ubuntu" -o "$OSREL" == "Debian" ]; then
    /usr/sbin/groupadd -r joy 2> /dev/null || :
    /usr/sbin/useradd -g joy -s /sbin/nologin -M -r -d / joy 2> /dev/null || :
fi
